﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Models;
using System.Data;
using System.Data.SqlClient;
using DBUnitility;
namespace DAL
{
    public class TrackInfoService
    {
        /// <summary>
        /// AGV轨道访问类
        /// </summary>
        /// <returns></returns>
        public List<TrackInfo> GetAllTrack()
        {
            string sql = "select TrackId,TrackName from TrackInfo";
            List<TrackInfo> list = new List<TrackInfo>();
            SqlDataReader objReader = SQLHelper.GetReader(sql);
            while (objReader.Read())
            {
                list.Add(new TrackInfo() { TrackId = Convert.ToInt32(objReader["TrackId"]), TrackName = objReader["TrackName"].ToString() });
            }
            objReader.Close();
            return list;
        }
    }
}
